<template>
  <div class="wapper">
    <div class="title">
      <span class="back iconfont" @click="handleBackClick">&#xe606;</span>
      我的地址
    </div>
    <div class="address_content" v-for="(item, index) in address" :key="index">
      <div class="my_info">
        <span class="my_name">{{ item.uname }}</span>
        <span class="my_phone">{{ item.phoneNum }}</span>
      </div>
      <div class="my_address">
        {{ item.address }}
      </div>
    </div>
  </div>
</template>
<script>
import { useRouter } from "vue-router";

export default {
  name: "MyAddress",
  setup() {
    const router = useRouter();
    const address = [
      {
        uname: "小红",
        phoneNum: 13369859200,
        address: "北京海淀区西三环北路2号院北京理工大学国防科技园",
      },
      {
        uname: "小明",
        phoneNum: 15369859200,
        address: "陕西省临潼区西安科技大学临潼校区",
      },
    ];
    const handleBackClick = () => {
      router.back();
    };
    return { handleBackClick, address };
  },
};
</script>
<style lang="scss" scoped>
.wapper {
  overflow-y: scroll;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #eee;
}
.title {
  position: relative;
  line-height: 0.5rem;
  font-size: 0.16rem;
  text-align: center;
  background-color: #fff;
  .back {
    position: absolute;
    left: 0.18rem;
    font-size: 0.14rem;
  }
}
.address_content {
  margin: 0.18rem;
  padding: 0.16rem;
  font-size: 0.16rem;
  background-color: #fff;
  .my_info {
    color: #999;
    margin-bottom: 0.14rem;
    .my_name {
      margin-right: 0.3rem;
    }
  }
}
</style>
